Conversation
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The hook is used in Risk is low because:
SmokeTrade is selected as a conservative measure since the Earn staking feature falls under that category, and the mUSD conversion flow is part of the Earn ecosystem. Performance Test Selection: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28644 +/- ##
==========================================
+ Coverage 82.13% 82.14% +0.01%
==========================================
Files 4942 4949 +7
Lines 129947 130065 +118
Branches 28977 29002 +25
==========================================
+ Hits 106732 106844 +112
- Misses 15917 15924 +7
+ Partials 7298 7297 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
@metamaskbot update-mobile-fixture |
|
✅ E2E Fixture Validation — Schema is up to date |
Matt561
left a comment
There was a problem hiding this comment.
I'm unable to test at the moment. There's an issue preventing fetching of Relay quotes for the conversion flow. Approving since the changes seem straightforward to unblock. 👍



Description
Removes the usage of
selectERC20TokensByChain(which reads fromtokensChainsCache) inuseMusdConversionStatus. This is part of a broader effort to eliminate all usages oftokensChainsCachefrom the codebase so it can eventually be removed fromTokenListController.Previously,
getTokenDatainside the hook'suseEffectlooked up a token'ssymbolandnamefrom the fulltokensChainsCachevia auseSelector+refpattern. This required subscribing to the entire chain-indexed token list on every render.The replacement uses
selectSingleTokenByAddressAndChainIdcalled directly againststore.getState()at the moment the transaction event fires — the same point-in-time store access pattern already used in this hook forgetTransactionPayQuotes. SincemetamaskPay.tokenAddressis always a token the user holds in their wallet, it is tracked inTokensController.allTokens, making thetokensChainsCachelookup redundant.Also removes the now-unnecessary
safeToChecksumAddressimport (previously used to handle both checksummed and lowercase address lookups, whichselectSingleTokenByAddressAndChainIdhandles internally), and drops thetokensCacheRefref pattern along with theuseSelector/react-reduximport.Changelog
CHANGELOG entry: remove usage of tokensChainsCache from useMusdConversionStatus
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2956
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Moderate risk because it changes how token metadata is resolved for mUSD conversion toasts/metrics (switching data sources and lookup behavior), which could alter displayed symbols and analytics properties in edge cases.
Overview
useMusdConversionStatusno longer readstokensChainsCacheviareact-redux/selectERC20TokensByChain; it now pulls tokensymbol/nameon-demand fromstore.getState()usingselectSingleTokenByAddressAndChainId.Tests are updated to mock the new selector-based lookup, remove the old chain token-cache setup (including lowercase/checksum fallback coverage), and adjust the fallback case to treat missing wallet tokens as
"Token".Reviewed by Cursor Bugbot for commit 9de0418. Bugbot is set up for automated code reviews on this repo. Configure here.